function t(t) {
    n.sendrequest("posterapi/getspecial", "POST", {
        token: t,
        spage: o,
        sptype: 3
    }, function(t) {
        1 == t.status && (a.setData({
            speciallist: a.data.speciallist.concat(t.data)
        }), c = c.concat(t.data));
    });
}

function e(t) {
    for (var e = -1, a = 0; a < c.length; a++) if (c[a].special_id == t) {
        e = a;
        break;
    }
    return e;
}

var a, i, n = require("../../utils/util.js"), s = "", o = 1, r = getApp().globalData.url.imgurl, c = new Array();

Page({
    data: {
        imgurl: r,
        speciallist: c
    },
    onLoad: function() {
        o = 1, a = this, n.getToken(function(t) {
            i = t;
        }), t(i);
    },
    onReachBottom: function() {
        o += 1, t(i);
    },
    onShareAppMessage: function(t) {
        return {
            title: "小婷海报",
            path: "pages/emoticon/emoticon",
            success: function(t) {},
            fail: function(t) {}
        };
    },
    posterload: function(t) {
        if (t.currentTarget.dataset.id > 0) {
            var s = e(t.currentTarget.dataset.id);
            c[s].page = parseInt(c[s].page) + 1, n.sendrequest("posterapi/speciallist", "POST", {
                token: i,
                page: c[s].page,
                id: t.currentTarget.dataset.id
            }, function(t) {
                if (1 == t.status) {
                    var i = e(t.data.id);
                    c[i].ilist = c[i].ilist.concat(t.data.list), a.setData({
                        speciallist: c
                    });
                }
            });
        }
    },
    redirtbyid: function(t) {
        wx.navigateTo({
            url: "/pages/poster/poster?micro_id=" + t.detail.target.dataset.id
        }), n.getToken(function(e) {
            n.sendrequest("posterapi/setfrom", "POST", {
                token: e,
                formid: t.detail.formId
            }, function(t) {});
        });
    },
    cingput: function(t) {
        s = t.detail.value;
    },
    submit: function(t) {
        wx.navigateTo({
            url: "/pages/posterlist/posterlist?is_dynamic=1&keyword=" + s
        });
    }
});